package com.lap.analysis.tools;

import java.util.List;

/**
 * 信息注解
 *
 * @author Shuisheng Lao(劳水生)
 * @version 0.0.1
 */
public abstract class Message {

  public static final List<String> MOCK_LIST =
      List.of(
          "import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;",
          "import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;",
          "import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;",
          "import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;",
          "import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;",
          "import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;",
          "import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;");

  // @formatter on
  public static final List<String> JUNIT_LIST =
      List.of(
          "import org.junit.jupiter.api.DisplayName;",
          "import org.junit.jupiter.api.MethodOrderer;",
          "import org.junit.jupiter.api.Test;",
          "import org.junit.jupiter.api.Order;",
          "import org.junit.jupiter.api.TestMethodOrder;",
          "import org.junit.jupiter.api.Timeout;",
          "import org.junit.jupiter.api.extension.ParameterContext;",
          "import org.junit.jupiter.params.ParameterizedTest;",
          "import org.junit.jupiter.params.aggregator.AggregateWith;",
          "import org.junit.jupiter.params.aggregator.ArgumentsAccessor;",
          "import org.junit.jupiter.params.aggregator.ArgumentsAggregationException;",
          "import org.junit.jupiter.params.aggregator.ArgumentsAggregator;",
          "import org.junit.jupiter.params.provider.CsvFileSource;",
          "import org.junit.jupiter.params.provider.CsvSource;");
  // @formatter off

  // @formatter on
  public static final List<String> ENTITY_LIST =
      List.of(
          "import com.lap.framework.tools.JsonUtil;",
          "import com.lap.junit.entity.ArgEntity;",
          "import com.lap.junit.entity.ArgMap;",
          "import com.lap.junit.tools.ArgUtil;");
  // @formatter off

  public static final List<String> REQUEST_LIST =
      List.of("import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;");

  public static final List<String> MEDIA_TYPE_LIST =
      List.of("import org.springframework.http.MediaType;");

  // @formatter on
  public static final List<String> UTIL_LIST =
      List.of(
          "import java.util.List;",
          "import java.util.Date;",
          "import java.util.HashMap;",
          "import java.util.Map;");
  // @formatter off

  public static final String DISPLAY_NAME = "%s@DisplayName(\"%s\")%s";
  public static final String METHOD_ORDER =
      "@TestMethodOrder(MethodOrderer.OrderAnnotation.class)%s";

  public static final String CLASS_BEFORE = "class %sTest";
  public static final String ClASS_CONTEXT = " {%s%s%s}%s";

  public static final String ORDER = "%s@Order(%s)%s";
  public static final String PARAMETER_TEST = "%s@ParameterizedTest%s";

  public static final String CVS_FILE =
      "%s@CsvFileSource(resources = {\"%s/%s.csv\"}, numLinesToSkip = 1)%s";
  public static final String CVS_SOURCE = "%s@CsvSource(value = {\"%s\"})%s";

  public static final String OVERRIDE = "%s@Override%s";
  public static final String AGGREGATE_CONTENT =
      "%spublic ArgMap aggregateArguments(ArgumentsAccessor accessor, ParameterContext context) throws ArgumentsAggregationException {%s%s%s}%s";
  public static final String ENTITY_ARRAY = "%sArgEntity[] _entityList = new ArgEntity[%s];%s";
  public static final String ENTITY_INDEX =
      "%s_entityList[%s] = new ArgEntity(\"%s\", %s.class);%s";
  public static final String ENTITY_UTIL = "%sreturn ArgUtil.arg2Map(accessor, _entityList);%s";

  public static final String AGGREGATE = "@AggregateWith(%s.class) ArgMap map";
  public static final String INNER_CLASS =
      "%sstatic class %s implements ArgumentsAggregator {%s%s%s}%s";

  public static final String TEST_METHOD = "%svoid test%s(%s) throws Exception {%s%s%s}%s";
  public static final String PACKAGE = "package %s;%s";
}
